package com.itgungnir.diyshuo.fragment.fenlei_items_fragment;

import android.support.v4.app.FragmentActivity;
import android.widget.GridView;
import android.widget.TextView;

/**
 * 分类页面两个Fragment中相当于MVP模式中Presenter层的类
 */
public class FenleiItemPresenter implements FenleiItemContract.Presenter {
    private FenleiItemContract.Model model;
    private FenleiItemContract.View view;

    public FenleiItemPresenter(FenleiItemContract.View view) {
        this.view = view;
        this.model = new FenleiItemModel();
    }

    @Override
    public void setTextToTextView(TextView tv, String text) {
        model.setTextToTextView(tv, text);
    }

    @Override
    public void setContentToGridView(FragmentActivity activity, GridView gv, int[] images, String[] titles) {
        model.setContentToGridView(activity, gv, images, titles);
    }

    @Override
    public void onGridViewItemClickListener(FragmentActivity activity, int position, String title, boolean isAdd) {
        model.onGridViewItemClickListener(activity, position, title, isAdd);
    }
}